package cn.jiyun.client;


import cn.jiyun.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("userservice")
public interface AdminClients {

    @GetMapping("user/findPage")
    public String findPage(@RequestParam(required = true, defaultValue = "1")Integer pageIndex, @RequestParam("name") String name);

    @PostMapping("user/add")
    public String add(@RequestBody User user);

    @GetMapping("user/del")
    public String del(@RequestParam("id") Integer id);

    @PostMapping("user/edit")
    public String edit(@RequestBody User user);

    @GetMapping("user/findById")
    public String findById(@RequestParam("id")Integer id);
}
